﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Tzc_VoteSys.Models;
using Tzc_VoteSys.Models.Database;
using Tzc_VoteSys.Service;

namespace Tzc_VoteSys.Service
{
    public class Users : IUsers
    {
        private readonly Tzc_VoteSysContext _db;
        public Users(Tzc_VoteSysContext db)
        {
            _db = db;
        }
        /// <summary>
        /// 判断邮箱是否存在
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        public bool ExistEmail(string email)
        {
            var Login = _db.Users.Any(x => x.Email == email);
            return Login;
        }
    }
}
